<!--
 * @Descripttion: 岗位报单配置
 * @version: 
 * @Author: ada.wu
 * @Date: 2025-07-02 02:24:59
 * @LastEditors: ada.wu
 * @LastEditTime: 2025-07-11 10:52:46
-->
<style>
    .camera .layuimini-form .layui-form-item .layui-form-label {
        width: 100px !important;
        padding-right: 0 !important;

    }

    .camera .layuimini-form .layui-form-item .layui-input-block {
        margin-left: 110px !important;
    }
</style>
<div class="camera layuimini-page-anim">
    <div class="layuimini-main">
        <div class="layui-form layuimini-form">

            <div class="layui-form-item">
                <label class="layui-form-label required">岗位
                </label>
                <div class="layui-input-block">
                    <input type="text" name="username" lay-verify="required" lay-reqtext="管理账号不能为空"
                        placeholder="请输入管理账号" value="admin" class="layui-input">


                </div>
            </div>
            <div class="layui-font-gray layui-font-12 mb-3">系统通过名称匹配生效，请和“百川云”中人员的“主要岗位”或“基础数据配置”中人员的“岗位”名称保持一致。</div>
            <div>默认工作位置</div>
            <div class="layui-form-item">
                <label class="layui-form-label p-0">
                    <select class="layui-input" lay-append-to="body" placeholder="请选择" name="businessNames" lay-search>
                        <option value="1">级联</option>
                        <option value="2">搜索</option>
                    </select>
                </label>
                <div class="layui-input-block">
                    <select class="layui-input" lay-append-to="body" placeholder="请选择" name="businessNames" lay-search>
                        <option value="1">清扫保洁</option>
                        <option value="2">绿化养护</option>
                        <option value="3">设施维护</option>
                        <option value="4">其他</option>
                    </select>

                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">默认工单来源</label>
                <div class="layui-input-block">
                    <select class="layui-input" lay-append-to="body" placeholder="请选择" name="businessNames" lay-search>
                        <option value="1">清扫保洁</option>
                        <option value="2">绿化养护</option>
                        <option value="3">设施维护</option>
                        <option value="4">其他</option>
                    </select>

                </div>
            </div>

            <div class="solid-top pt-5">
                <div class="flex-center">
                    <button class="layui-btn layui-btn-primary layui-btn-sm btn-70" lay-on="closeBtn">取消</button>
                    <button class="layui-btn layui-btn-normal layui-btn-sm btn-70" lay-submit
                        lay-filter="saveBtn">确认保存</button>
                </div>
            </div>


        </div>
    </div>
</div>
<script>
    layui.use(['form', 'miniPage'], function () {
        var form = layui.form,
            $ = layui.$,
            layer = layui.layer,
            util = layui.util,
            miniPage = layui.miniPage;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();
         form.render('select'); //刷新select选择框渲染
        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;
        // 普通事件
        util.on('lay-on', {
            // 关闭弹出层
            "closeBtn": function () {
                layer.close(parentIndex);

            }
        });


        //监听提交
        form.on('submit(saveBtn)', function (data) {
            var BBBs = [];
            $('input[name="BBB[]"]:checked').each(function () {
                BBBs.push($(this).val());
            });
            var result = JSON.stringify({ ...data.field, BBBs });
            var index = layer.alert(result, {
                title: '最终的提交信息'
            }, function () {
                // 关闭弹出层
                layer.close(index);
                layer.close(parentIndex);
            });
            return false;
        });

    });
</script>